package com.ruoyi.weiriya.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.ruoyi.weiriya.mapper.WPayVipRecordMapper;
import com.ruoyi.weiriya.domain.WPayVipRecord;
import com.ruoyi.weiriya.service.IWPayVipRecordService;

import java.util.Date;
import java.util.List;

/**
 * 用户购买会员记录Service业务层处理
 * 
 * @author lynn
 * @date 2023-08-01
 */
@Service
public class WPayVipRecordServiceImpl extends ServiceImpl<WPayVipRecordMapper, WPayVipRecord> implements IWPayVipRecordService
{

    @Override
    public List<WPayVipRecord> effectiveList(String memberId) {
        List<WPayVipRecord> list = this.list(new LambdaQueryWrapper<WPayVipRecord>()
                .eq(WPayVipRecord::getMemberId, memberId)
                .ge(WPayVipRecord::getEndTime, new Date()));
        return list;
    }
}
